import java.util.*;

public class Solution {
    public String minNumber(int[] nums) {
        Integer[] nums_ = new Integer[nums.length];
        for (int i = 0; i < nums.length; i++) nums_[i] = nums[i];
        Arrays.sort(nums_, new Comparator<Integer>() {
            @Override
            public int compare(Integer i1, Integer i2) {
                String s1 = i1.toString();
                String s2 = i2.toString();
                String ss1 = s1 + s2;
                String ss2 = s2 + s1;
                Long ii1 = Long.parseLong(ss1);
                Long ii2 = Long.parseLong(ss2);
                return ii1.compareTo(ii2);
            }
        });
        StringBuilder ans = new StringBuilder();
        for (Integer in : nums_) {
            ans.append(in.toString());
        }
        return ans.toString();
    }
}